﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using verk2013_project_group12.Models;

namespace verk2013_project_group12.Models
{
   public class GameRepository
    {
        AppDataContext db = new AppDataContext();
        public IEnumerable<Game> GetAllGames()
        {
            return db.Games;
        }

        public Game GetGameById(int id)
        {
            var theGame = (from i in db.Games
                           where i.ID == id
                           select i).SingleOrDefault();
            return theGame;
        }

    } 
}